﻿using System;
using YourWorld.Common.Services;
using System.Collections.ObjectModel;
using BusinessObjects;
using YourWorld.Common.GreenWorldEntitiesService;
using System.Data.Services.Client;
using System.Linq;
using System.Collections.Generic;

namespace MainGameModule.Models
{
    public class DataModel : IDataModel, IDisposable
    {        
        public DataModel()
        {
            this.Initialize();
        //    RubbishBinsRepository.Instance.Initialize();

        //    RegionObjectsRepository.Instance.Loaded += () =>
        //    {
        //        PlayersRepository.Instance.Initialize();
        //    };

        //    BadgesRepository.Instance.BadgesLoaded += ( x ) =>
        //    {
        //        RegionObjectsRepository.Instance.Initialize();
        //    };

        //    BadgesRepository.Instance.Initialize();
        //    QuestionsRepository.Instance.Initialize();
        //    // RegionObjectsRepository.Instance.Initialize();

        }

        public void Initialize()
        {
            RubbishBinsRepository.Instance.Initialize();

            RegionObjectsRepository.Instance.Loaded += () =>
            {
                PlayersRepository.Instance.Initialize();
            };

            BadgesRepository.Instance.BadgesLoaded += ( x ) =>
            {
                RegionObjectsRepository.Instance.Initialize();
            };

            BadgesRepository.Instance.Initialize();
            QuestionsRepository.Instance.Initialize();
        }

        public void ReadRubbishes()
        {

        }

        public void ReadHerbs()
        {

        }

        public void ReadSpecies()
        {

        }

        public void ReadQuestions()
        {
        }

        public void ReadFacts()
        {
        }

        public void ReadLevel( int levelNum )
        {

        }

        public void Dispose()
        {

        }



    }
}
